package com.z.ssmdemo.filter;



import java.util.List;


/**
 * 责任链模式控制类
 */
public abstract class AbstractAiPicFilter implements IAiPicFilter {
    protected AbstractAiPicFilter nextAbstractAiPicFilter;

    public final Object handleRequest(Object taskDataSubmitRecord, List<Object> wordObjs) {
        AiPicModel aiPicModel = doFilter(taskDataSubmitRecord, wordObjs);
        if (aiPicModel.isSuccess()) {
            if (null == nextAbstractAiPicFilter) {
                return new AiPicModel(true, null);
            } else {
                return nextAbstractAiPicFilter.handleRequest(taskDataSubmitRecord, wordObjs);
            }
        } else {
            return aiPicModel;
        }
    }
}
